package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.CharacterSetSpecificationList;
import com.yanmaohu.yulia.bean.ValueSpecification;

public final class SetSessionCollationStatementSubtype1 implements SetSessionCollationStatement {

    private int beginIndex;
    private int endIndex;
    private ValueSpecification collationSpecification;
    private CharacterSetSpecificationList characterSetSpecificationList;

    public SetSessionCollationStatementSubtype1(int beginIndex,
                                                ValueSpecification collationSpecification,
                                                CharacterSetSpecificationList characterSetSpecificationList) {
        this.beginIndex = beginIndex;
        this.endIndex = characterSetSpecificationList != null ? characterSetSpecificationList.getEndIndex() : collationSpecification.getEndIndex();
        this.collationSpecification = collationSpecification;
        this.characterSetSpecificationList = characterSetSpecificationList;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public ValueSpecification getCollationSpecification() {
        return collationSpecification;
    }

    public CharacterSetSpecificationList getCharacterSetSpecificationList() {
        return characterSetSpecificationList;
    }

}
